package com.ruoyi.web.controller.prevention;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.PrcentageUtils;
import com.ruoyi.system.domain.vo.PreventionCheckTaskConfigCountVO;
import com.ruoyi.system.service.InspectionPlanTaskDetailsService;
import com.ruoyi.system.service.InspectionPlanTaskService;
import com.ruoyi.system.service.PreventionHiddenRegisterService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 巡检统计
 * @author
 * @since 2022-11-28 17:55:24
 */
@RestController
@RequestMapping("preventionHiddenRegisterCount")
public class PreventionHiddenRegisterCountController extends BaseController {
    @Resource
    private InspectionPlanTaskService inspectionPlanTaskService;
    @Resource
    private InspectionPlanTaskDetailsService inspectionPlanTaskDetailsService;
    @Resource
    private PreventionHiddenRegisterService preventionHiddenRegisterService;

    /**
     * 统计_排查任务完成率、待排查任务数量、待整改隐患数量
     */
    @GetMapping("/countHiddenRegisterAll")
    public AjaxResult countHiddenRegisterAll() {
        Map<String, Object> map = new HashMap<>();
        PrcentageUtils prcentageUtils = new PrcentageUtils();
        int bflCount = inspectionPlanTaskService.getBflCount();
        int wclCount = inspectionPlanTaskService.getWclCount();
        int zgCount = inspectionPlanTaskService.getZgCount();
        int pcCount = inspectionPlanTaskService.getPcCount();
        map.put("待整改隐患",zgCount);
        map.put("待排查任务",pcCount);
        map.put("排查任务完成率",prcentageUtils.percent(wclCount,bflCount));
        return AjaxResult.success(map);
    }

















}

